package com.example.basic.controller;

import com.example.basic.domain.SanctionsEntity;
import com.example.basic.service.CsvDownloadService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author mjw
 * @date 2023/3/23
 */
@RestController
@Api(tags = "csv下载的控制器")
@RequestMapping("/csv")
public class CsvDownloadController {

    private final CsvDownloadService csvDownloadService;

    @Autowired
    public CsvDownloadController(CsvDownloadService csvDownloadService) {
        this.csvDownloadService = csvDownloadService;
    }

    @GetMapping("/sanction")
    public List<SanctionsEntity> csvSanctionDownload() {
        return csvDownloadService.csvSanctionDownload();
    }
}
